package kr.hkit.androidcomplete01.chaptert11;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import android.widget.TextView;

public class TextChangeEx extends Activity {
	EditText mEdit;
	TextView mText;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.textchange);
		
		mEdit = (EditText) findViewById(R.id.ch11_tcedit);
		mText = (TextView) findViewById(R.id.ch11_tctext);
		mEdit.addTextChangedListener(mWatcher);
	}
	
	TextWatcher mWatcher =new TextWatcher() {
		
		@Override
		public void onTextChanged(CharSequence s, int start, int before, int count) {
			mText.setText("echo : " + s);
		}
		
		@Override
		public void beforeTextChanged(CharSequence s, int start, int count,	int after) {
		}
		
		@Override
		public void afterTextChanged(Editable s) {			
		}
		
	};
}
